import request from "./request.js"



async function getUserInfo(uid, fieldsToQuery) {
	try {
		const response = await request.get(`/api/find/user/${uid}`, {
			params: {
				fields: fieldsToQuery
			}
		})
		return response.data;
	} catch (error) {
		console.error('获取用户信息失败:', error);
		throw error;
	}
}

function getAllCarousels() {
	return request.get('/api/getAllCarousels');
}

function getUserCardList(_id) {
	return request.get('/api/getUserCardList', {
		params: {
			_id: _id
		}
	});
}
module.exports = {
	getAllCarousels,
	getUserInfo,
	getUserCardList
}